(ns qwiz.utils.QParcer)

;;
;

(defn parceTestBase[path]
  (map #(let [_v (vec %)] {:q (first _v) :a1 (_v 1) :a2 (_v 2) :a3 (_v 3) :a4 (_v 4)})
    (let [s (slurp path)]
      (partition 5 (filter #(and (not (= % nil))
                              (not (.startsWith % "Вопросы на"))
                              (not (.equals(.trim %) ""))
                              (not (.startsWith % "(")))
                     (vec (seq (.split s "\r\n"))))))))


;DEBUG!
(spit "c:/dump.txt" (.replaceAll (apply str (parceTestBase "../../../baza.txt")) "}" "}\r\n") :encoding "UTF-8")

;(println (parceTestBase))

